#include "fxcc/core/Cache.h"

using namespace fxcc;
using namespace fxcc::yml;

template<>
void Serializer::Encode<Cache::File>(YAML::Node& node, const Cache::File& inst)
{
	SetVariable<int>(node, "ModifyTime", inst.m_ModifyTime);
	SetVariable<std::string>(node, "Path", inst.m_Path);

}


template<>
bool Serializer::Decode<Cache::File>(const YAML::Node& node, Cache::File& inst)
{

	GetVariable<int>(node, "ModifyTime", inst.m_ModifyTime);
	GetVariable<std::string>(node, "Path", inst.m_Path);


	return true;

}

template<>
void Serializer::Encode<Cache>(YAML::Node& node, const Cache& inst)
{

	SetVariable<std::string>(node, "LastOpen", inst.m_LastOpen);
	SetArrayVariable<Cache::File>(node, "Recents", inst.m_Recents);


}


template<>
bool Serializer::Decode<Cache>(const YAML::Node& node, Cache& inst)
{
	GetVariable<std::string>(node, "LastOpen", inst.m_LastOpen);
	GetArrayVariable<Cache::File>(node, "Recents", inst.m_Recents);


	return true;

}